Release 10.1A: OpenEdge Development:
Programming Interfaces
Database aliases
An alias is a synonym for a logical database name. You use an alias as a database reference in Progress procedures in place of a logical database name.
You establish a logical database name when you connect a OpenEdge session to a physical database. You create and assign an alias to a logical database name of an already connected database using the
CREATEALIASstatement. By reassigning an alias to different logical database names, you can run a compiled procedure on other connected databases that have identical structure and time stamps or CRC values for the tables referenced by the procedure. A logical database name can have more than one alias, but each alias refers to only one logical database name at a time.The OpenEdge Data Dictionary offers an example of alias usage. The OpenEdge Data Dictionary is a general-purpose OpenEdge application that works on any database that has
Note: Because of the need to reassign of theDICTDBas an alias. The first database connected during a OpenEdge session automatically receives the aliasDICTDB. During a OpenEdge session, you can reassign theDICTDBalias to another connected database with the Select Working Databases option on the Database menu in the OpenEdge Data Dictionary.DICTDBalias, OpenEdge does not allow you to run the OpenEdge Data Dictionary against a database connected with the logical nameDICTDB.Use the
CREATEALIASstatement during a OpenEdge session to assign or reassign an alias to a connected database. You can use this statement from the Progress editor or from an application procedure. This is the syntax for theCREATEALIASstatement:
The
aliasargument can be an unquoted string, a quoted string, or an expression. Thelogical–nameargument represents the existing logical name of a connected database. It can be an unquoted string, a quoted string, or an expression. You cannot create an alias that is the same as the logical database name of a connected database. The named database must be connected unless you use theNO–ERRORoption.When you create an alias, OpenEdge logs the alias assignment in a table that remains in memory for the current session. If you use the
DISCONNECTstatement to disconnect a database from within an application, all existing aliases assigned to the logical database name remain in the alias table until the end of the OpenEdge session. Later, if you connect to a database with the same logical database name during the same OpenEdge session, you can use the same aliases to reference that logical database name. If you create an alias that already exists in the session alias table, OpenEdge replaces the existing alias with the new alias. This allows you to reassign existing aliases to new logical database names.The
DELETEALIASstatement allows you to delete an alias from the alias table of the current OpenEdge session:
The
aliasargument represents an alias that exists in the current alias session table.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |